<?php
class ModelConfigReply extends Model {
	
	public function editReply($keyword_id, $data) {
		$this->deleteReply($keyword_id);
		$this->db->query("insert into `" . DB_PREFIX . "config_keyword_replay` SET ".
		"content = '" . $this->db->escape($data['content']) . "', ".
		"keyword_id = '" . (int)$data['keyword_id'] . "'");
	}
	
	public function getReply($keyword_id) {
		$query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "config_keyword_replay` WHERE keyword_id = '" . (int)$keyword_id . "'");
		return $query->row;
	}
	
	public function deleteReply($keyword_id) {
		$this->db->query("DELETE FROM `" . DB_PREFIX . "config_keyword_replay` WHERE keyword_id = '" . (int)$keyword_id . "'");
	}
}
?>